package com.jackchong.base

import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import com.jackchong.net.JBaseData
import com.uber.autodispose.AutoDisposeConverter

/**
 * author : jack(黄冲)
 * e-mail : 907755845@qq.com
 * create : 2020/8/6
 * desc   :
 */
interface BaseView : LifecycleOwner{

    fun showLoading()

    fun hideLoading()

    fun lifecycle(): Lifecycle

    fun onFill(bean: JBaseData<*>)

    fun onError(cause: Throwable)

    fun <T> bindAutoDispose(): AutoDisposeConverter<T>

    fun isActive(): Boolean = lifecycle().currentState != Lifecycle.State.DESTROYED
}